package com.liuguang.gateway.controller;

import com.liuguang.common.pojo.CommonResult;
import com.liuguang.gateway.config.security.controller.UserController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: BusinessController
 * @Description：
 * @Author: wanghr
 * Date: 7:23 PM 2020/9/21
 * Version: 1.0
 */
@RestController
@RequestMapping("/api/business")
public class BusinessController {
    private static final Logger logger = LoggerFactory.getLogger(BusinessController.class);

    /**
     * 限制接口访问，参数权限信息 与 用户权限对比
     *
     * @params: []
     * @return: com.liuguang.common.pojo.CommonResult
     */
    @PreAuthorize("hasAnyAuthority('普通员工')")
    @RequestMapping(value = "/test", method = RequestMethod.POST)
    public CommonResult test() {
        System.out.println("进入测试方法");
        return CommonResult.success();
    }
}
